import request from '@/config/axios'

// ERP 随货同行单项 VO
export interface SupplierSendOrderItemVO {
  id: number // 编号
  outOrderId: string // 随货同行单编号
  productId: number // 产品编号
  productUnit: number // 产品单位
  productStandards: number // 产品规格
  productPrice: number // 产品单价
  batch: string // 批次
  validityDate: Date // 有效期
  count: number // 数量
  totalPrice: number // 总价
  remark: string // 备注
}

// ERP 随货同行单项 API
export const SupplierSendOrderItemApi = {
  // 查询ERP 随货同行单项分页
  getSupplierSendOrderItemPage: async (params: any) => {
    return await request.get({ url: `/erp/supplier-send-order-item/page`, params })
  },

  // 查询ERP 随货同行单项详情
  getSupplierSendOrderItem: async (id: number) => {
    return await request.get({ url: `/erp/supplier-send-order-item/get?id=` + id })
  },

  // 新增ERP 随货同行单项
  createSupplierSendOrderItem: async (data: SupplierSendOrderItemVO) => {
    return await request.post({ url: `/erp/supplier-send-order-item/create`, data })
  },

  // 修改ERP 随货同行单项
  updateSupplierSendOrderItem: async (data: SupplierSendOrderItemVO) => {
    return await request.put({ url: `/erp/supplier-send-order-item/update`, data })
  },

  // 删除ERP 随货同行单项
  deleteSupplierSendOrderItem: async (id: number) => {
    return await request.delete({ url: `/erp/supplier-send-order-item/delete?id=` + id })
  },

  // 导出ERP 随货同行单项 Excel
  exportSupplierSendOrderItem: async (params) => {
    return await request.download({ url: `/erp/supplier-send-order-item/export-excel`, params })
  },
}